#include "titlescreen.h"
#include "globals.h"
#include <QPainter>

TitleScreen::TitleScreen(QWidget *parent) : QWidget(parent)
{
}
	
void TitleScreen::paintEvent(QPaintEvent *event)
{
	QPainter painter(this);
	painter.setRenderHint(QPainter::Antialiasing);
	
	QLinearGradient gradient(rect().topLeft(), rect().bottomRight());
	gradient.setColorAt(0.0, Qt::black);
	gradient.setColorAt(1.0, QColor(64, 64, 64));
	
	painter.setPen(Qt::NoPen);
	painter.setBrush(QBrush(gradient));
	painter.drawRect(rect());
	
	painter.setPen(QPen(Qt::white));
	painter.setFont(QFont("Helvetica", 36, QFont::Bold));
	painter.drawText(rect(), Qt::AlignVCenter | Qt::AlignHCenter,
		"PROFIT\nThe game");
		
	painter.setFont(QFont("Helvetica", 10));
	painter.drawText(rect(), Qt::AlignBottom | Qt::AlignRight,
		"Profit v" + Profit::Version + " ");
}